<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<button onclick="fun()">批量增加10行文本</button>
		<script>
			function fun(){
				var cdf = document.createDocumentFragment();
				for (var i=1;i<=10;i++) {
					var ele = document.createElement("span");
					ele.innerHTML = "这是文本"+i;
					ele.setAttribute("style","display: block;");
					cdf.appendChild(ele);
				}
				document.body.appendChild(cdf);
			}			
		</script>
	</body>
</html>
